From 8f2598e9fe153ee512667052908e63c3409090bc Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 6 Nov 2025 14:37:06 +0100 Subject: [PATCH] messageList: Recognize URLHighlighter gesture only if clicking on an URL Otherwise it would still consume the press+release, making the overall notification unable to handle activation. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8799 Part-of: --- js/ui/messageList.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/ui/messageList.js b/js/ui/messageList.js index deed5eb02..85fc044d3 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -56,10 +56,18 @@ class URLHighlighter extends St.Label { this.setMarkup(text, allowMarkup); this._clickGesture = new Clutter.ClickGesture(); - this._clickGesture.connect('recognize', this._onClick.bind(this)); + this._clickGesture.connectObject( + 'recognize', this._onClick.bind(this), + 'may-recognize', this._checkInUrl.bind(this)); this.add_action(this._clickGesture); } + _checkInUrl() { + const {x, y} = this._clickGesture.get_coords_abs(); + const urlId = this._findUrlAtPos(x, y); + return urlId !== -1; + } + _onClick() { const {x, y} = this._clickGesture.get_coords_abs(); const urlId = this._findUrlAtPos(x, y); -- 2.39.5